<template>
    <el-input v-model="inputValue" :placeholder='placeholder' @blur="getInputValue"></el-input>
</template>

<script>
    export default {
        data() {
            return {
                inputValue:''
            }
        },
        props:{
            label:{
                type: Object,
                default: () => {}
            },
            placeholder:{
                type:String,
                default:''
            },
            comData: {
                type: Object,
                default: () => {}
            },
        },
        mounted(){
            if(this.comData.defaultCode) this.inputValue = this.comData.defaultCode
        },
        methods:{
            getInputValue(){
                let obj = {}
                obj[this.label.label] = this.inputValue
                this.$emit('setFormData',obj)
            },
            reset(){
                this.inputValue = ''
                this.getInputValue()
            }
        }
    }
</script>